home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir31 / weird1sb.zip / WEIRD.BAT < prev    next >
DOS Batch File  |  1993-12-28  |  2KB  |  92 lines

  1. @echo off
  2.  
  3.     if "%1" == ""        goto syntax
  4.  
  5.     fe ( %1 ) do if $i:u == ON ret 1 ; if $i:u == OFF ret 2 ; ret 0
  6.     if errorlevel 2        goto weirdoff
  7.     if errorlevel 1        goto weirdon
  8.     goto syntax
  9.  
  10.  :weirdon
  11.     fm -qs
  12.     if errorlevel 1        goto fmloaded
  13.  
  14.     fm -qn64i
  15.     fm -qs
  16.     if errorlevel 1        goto loadedfm
  17.     goto fmerror
  18.  
  19.  :loadedfm
  20.     set LOADEDFM=1
  21.  
  22.  :fmloaded
  23.     fe -lweird1.pat do fmset $i > nul
  24.     bo
  25.     goto quit
  26.  
  27.  :weirdoff
  28.     fm -qs
  29.     if not errorlevel 1        goto nofm
  30.     bf
  31.  
  32.      if not "%LOADEDFM%" == "1"    goto quit
  33.     fm -qu
  34.  :nofm
  35.     set LOADEDFM=
  36.     goto quit
  37.  
  38.  :syntax
  39.     echo Syntax: weird on    or    weird off
  40.     echo This program makes weird sounds in the background.
  41.     echo Look at the end of WEIRD.BAT to read what it does and how.
  42.     goto quit
  43.  
  44.  :fmerror
  45.     echo Error loading FM.COM.  Unable to continue.
  46.     goto quit
  47.  
  48.  :nofm    
  49.     echo Sorry, but the TSR is not loaded.
  50.     goto quit
  51.  
  52.  :quit
  53.  
  54. :: This is the WEIRD.BAT file
  55. :: What it does is this:
  56. ::     if no argument given, display syntax and quit.
  57. ::    if invoked as "weird on", then activate weird sounds.
  58. ::    if invoked as "weird off", then deactivate the weird sounds.
  59. ::
  60. :: WEIRD ON
  61. ::    First, check to see if the FM.COM TSR is already loaded.
  62. ::    If so, then skip the loading procedure.
  63. ::    Otherwise, load FM.COM, and error out if it failed to load.
  64. ::     Use a 64 (-n64) entry queue to minimize memory utilization.
  65. ::     Then, set an environment variable indicating that we loaded FM.COM.
  66. ::    Then, for each line in the Pattern File, set the instrument timbre.
  67. ::    Finally, activate background sounds, and quit.
  68. ::
  69. :: WEIRD OFF
  70. ::    First, check to see if the FM.COM TSR is loaded.
  71. ::    If it is not, error out.
  72. ::    Otherwise, turn off the background sounds.
  73. ::    If the environment variable is not set to our key, then quit.
  74. ::    Otherwise, unload the TSR and unset the variable.
  75. ::
  76. :: Utility Programs
  77. ::
  78. :: FE.EXE - utility to execute multiple commands on a series of values.
  79. ::    Includes the ability to modify the values (:u -> make uppercase).
  80. ::    Also, can read a list file (-lfilename) for values.
  81. ::
  82. :: FM.COM - TSR to control the FM-chip on your sound board.
  83. ::    Installs (-i) and uninstalls (-u), with no display (-q).
  84. ::
  85. :: BO.COM - Activate background sounds in FM.COM.
  86. :: BF.COM - Deactivate background sounds in FM.COM.
  87. ::
  88. :: FMSET.EXE - Set Voice Timbre Parameters.  Used with FE.EXE to set each
  89. ::     voice to a specified timbre.  Modify the WEIRD1.PAT file to change
  90. ::    the instrument sound.
  91. ::    
  92.